package cn.cxy.codeviewdemo

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import thereisnospon.codeview.CodeViewTheme

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        codeView.setTheme(CodeViewTheme.ANDROIDSTUDIO).fillColor()
        codeView.showCode(
            "class MainActivity : AppCompatActivity() {\n" +
                    "    override fun onCreate(savedInstanceState: Bundle?) {\n" +
                    "        super.onCreate(savedInstanceState)\n" +
                    "        setContentView(R.layout.activity_main)\n" +
                    "    }\n" +
                    "}"
        )
//        codeView.showCode("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
//                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
//                "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
//                "    android:layout_width=\"match_parent\"\n" +
//                "    android:layout_height=\"match_parent\"\n" +
//                "    android:gravity=\"center\"\n" +
//                "    tools:context=\".MainActivity\">\n" +
//                "\n" +
//                "    <thereisnospon.codeview.CodeView\n" +
//                "        android:id=\"@+id/codeView\"\n" +
//                "        android:layout_width=\"match_parent\"\n" +
//                "        android:layout_height=\"match_parent\" />\n" +
//                "\n" +
//                "</LinearLayout>")
    }
}